Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

176
Visualizações
ServuceNow -> Header | Footer record - Send variable from Api Controller to Body HTML template widget tag

I'm trying to understand how to pass a variable from the "Client controller" field to the "Body HTML template" on a Header | Footer (sp_header_footer) record. We have a widget embedded in a lot of pages so we just created the widget and then added it like this:

HTML Body template field:

 <div>
     <widget id="widget" options='{"button_color":"#F6A700", "home_page_id":"sysid"}'></widget>
    </div>​

What I'm trying to do is, instead of passing that object into the options, I want to make it dynamic so I can get the info of those variables dynamic via server->client->HTML

Trying to do this:

HTML Body template field:

 <div>
      <widget id="widget" options='{c.options.obj}'></widget>
    </div>​

Client Controller field:

api.controller=function() {
  /* widget controller */
  var c = this;
  c.options.button_color = "#F6A700";
  c.options.obj = {
    "button_color":c.options.button_color,
    "portal_page_id": c.options.sys_id
};
};

But I can't get it to receive this information inside the widget itself, and since the widget is scope blocked, I really need to retrieve that info on this record, since it's on the Global scope. Can someone help me, please?

Best regards!

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda